-- Flup
-- GUI-Template




local StandardBackdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background ]], edgeFile =  [[Interface\Tooltips\UI-Tooltip-Border]], tile = false, edgeSize = 8}


function MakePanel(Name, Strata, Alpha, Xpos, Ypos, Scale, Width, Height)
local p = CreateFrame("Frame", "GUIPannel" .. Name, UIParent)
p:SetBackdrop(StandardBackdrop)
p:SetAplha(alpha)
p:SetFraneStrata(Strata)
p:SetPoint("BOTTOMLEFT")
p:SetWidth(Width)
p:SetHeight(Height)
p:SetScale(Scale)
return p
end

function MakeFontstring(Name, Parent, Xpos, Ypos, Scale,  Width, Height, Text)
local fs = guiFrame:CreateFontString("GUIFontstring"..Name,"OVERLAY")
fs:SetFontObject("GameFontNormal")
fs:SetHeight(Height)
fs:SetWidth(Width)
fs:SetScale(Scale)
fs:SetPoint("BOTTOMLEFT", Parent,"BOTTOMLEFT",Xpos,Ypos)
fs:SetText(Text)
return fs
end

function MakeButton(Name, Parent, Xpos, Ypos, Width, Height, Scale, Text)

local button = CreateFrame("Button", "GUIButton"..Name, guiFrame)
button:SetWidth(Width)
button:SetHeight(Height)
button:SetPoint("BOTTOMLEFT", Parent, "BOTTOMLEFT", Xpos, Ypos)
button:SetScale(Scale)

local t = gbutton:CreateTexture()
t:SetWidth(Width)
t:SetHeight(Height)
t:SetPoint("BOTTOMLEFT", Parent, "BOTTOMLEFT")
t:SetTexture("Interface\\Buttons\\UI-Panel-Button-Up")
t:SetTexCoord(0, 0.625, 0, 0.6875)
button:SetNormalTexture(t)

local t = button:CreateTexture(nil, "BACKGROUND")
t:SetTexture("Interface\\Buttons\\UI-Panel-Button-Down")
t:SetTexCoord(0, 0.625, 0, 0.6875)
t:SetAllPoints(button)
button:SetPushedTexture(t)

local t = gbutton:CreateTexture()
t:SetTexture("Interface\\Buttons\\UI-Panel-Button-Highlight")
t:SetTexCoord(0, 0.625, 0, 0.6875)
t:SetAllPoints(gbutton)
t:SetBlendMode("ADD")
button:SetHighlightTexture(t)

local buttontext = gbutton:CreateFontString(nil,"OVERLAY")
buttontext:SetFontObject(GameFontHighlight)
buttontext:SetText(Text)
buttontext:SetAllPoints(button)

return button
end

function MakeEditbox(Name, Parent, Xpos, Ypos, Width, Height, Scale, MaxLetters)
local editbox  =  CreateFrame("Editbox", "GUIEditbox"..Name, guiFrame)
editbox:SetWidth(Width)
editbox:SetScale(Scale)
editbox:SetHeight(Height)
editbox:SetPoint("BOTTOMLEFT", Parent, "BOTTOMLEFT", Xpos, Ypos)
editbox:SetMaxLetters(MaxLetters)
editbox:EnableKeyboard(true)
editbox:SetFontObject("GameFontNormal")
editbox:SetBackdrop({bgFile = "Interface/Buttons/WHITE8x8", insets = { left = 0, right = 0, top = 0, bottom = 0 }}) 
editbox:SetBackdropColor(0.5,0.5,0.5,0.5)
return editbox

end
